home *** CD-ROM | disk | FTP | other *** search
/ The X-Philes (2nd Revision) / The X-Philes Number 1 (1995).iso / xphiles / hp48_2 / terminal < prev    next >
Internet Message Format  |  1995-03-31  |  5KB

  1. From bgribble@jarthur.Claremont.EDU Fri Apr  6 22:35:27 1990
  2. From: bgribble@jarthur.Claremont.EDU (Bill Gribble)
  3. Newsgroups: comp.sys.handhelds
  4. Subject: hp48 terminal emulator: here it is!
  5. Keywords: slow as a pig with gland problems.
  6. Date: 3 Apr 90 18:00:19 GMT
  7. Organization: Harvey Mudd College, Claremont, CA 91711
  8.  
  9. Well, here it is: my humble effort at an hp48 terminal emulator.  It works,
  10.   but that's about it.  I'm still (as I posted yesterday) looking for faster
  11.   screen display routines, since this version loses text when it's sent
  12.   in blocks of more than about 20 characters - i.e., all the time.
  13.  
  14. I know it's functional because I used it to upload itself to this computer;
  15.   kermit is much more functional when you skip the pc step in the
  16.   ftp-to-unix <=> zmodem-to-pc <=> kermit-to-calc cycle, and it's pretty
  17.   impressive to see a 'username>' prompt on a calculator screen. 
  18.  
  19. Features:  semi-functional kermit shell: it receives right, but there's
  20.   an unknown (and moronic, I'm sure)  bug in the send program.  Invocation:
  21.   orange-shift backspace to send (it'll prompt you for a filename and do zip),
  22.   blue-shift backspace to receive.  In general, blue-shift is for SHIFT, 
  23.   orange shift is CNTRL. They're both toggles: once to start, again to enter 
  24.   normal text.  The alpha key sends a serial break.  DEL quits the program 
  25.   and cleans trash.
  26.     
  27. I haven't actually implemented the XON/XOFF flow control I mentioned
  28.   yesterday; that's version 1.1, I guess.  Other needs: punctuation marks;
  29.   they're destined to be shifted numbers.  Faster text display: I'm trying
  30.   out a few different things today.  
  31.  
  32. Sorry the thing is such a beast; I put it in one program to speed up 
  33.   the upload/edit/download/etc., so it takes twice as much memory
  34.   when it runs.  Easy to change, but editing the thing on the 48 is 
  35.   REALLY slow, so I'm doing the big revisions on the computer now that
  36.   I fixed my cable.
  37.  
  38. Have fun; any advice/suggestions are appreciated.
  39.  
  40.                                         Bill.
  41.  
  42. =============================================================================  
  43. =====   Bill Gribble           Internet: bgribble@jarthur.claremont.edu =====
  44. =====   Harvey Mudd College              wgribble@hmcvax.claremont.edu  =====
  45. =====   Claremont, CA 91711    Bitnet:   wgribble@hmcvax.bitnet         =====
  46. =====   (714) 621-8000 x2045                                            =====
  47. =============================================================================
  48.  
  49. =============================================================================
  50.  
  51. TERM 1.0: hp48 terminal emulator.  
  52. Bill Gribble.
  53.  
  54.  BYTES: 2181
  55. CHKSUM: # 2A05h
  56.  
  57. %%HP: T(3)A(R)F(.);
  58. \<<
  59.   \<<
  60.     IF DUP NUM 31 \<=
  61.     THEN
  62.       IF DUP NUM 8
  63. ==
  64.       THEN string
  65. DUP SIZE 1 - 1 SWAP
  66. SUB 'string' STO
  67. DROP ""
  68.       END
  69.       IF DUP NUM 13
  70. ==
  71.       THEN 'string'
  72. empt STO+ DROP ""
  73.       END
  74.     END 'string'
  75. SWAP STO+ string 7
  76. DISP
  77.     IF string SIZE
  78. 21 \>=
  79.     THEN LCD\-> {
  80. # 0d # 8d } {
  81. # 131d # 55d } SUB
  82. # 131d # 64d BLANK
  83. { # 0d # 0d } 3
  84. ROLL GOR \->LCD ""
  85. 'string' STO
  86.     END
  87.   \>>
  88.   \<<
  89.     IF DUP NUM 128
  90. <
  91.     THEN
  92.       IF DUP NUM 13
  93. ==
  94.       THEN 10 CHR +
  95.       END XMIT
  96.     ELSE DUP NUM
  97. 'nm' STO
  98.       IF nm 128 ==
  99.       THEN
  100.         IF 27 FS?
  101.         THEN 27 CF
  102. 26 CF
  103.         ELSE 26 CF
  104. 27 SF
  105.         END
  106.       ELSE
  107.         IF nm 129
  108. ==
  109.         THEN
  110.           IF 26 FS?
  111.           THEN 26
  112. CF 27 CF
  113.           ELSE 26
  114. SF 27 CF
  115.           END
  116.         ELSE
  117.           IF nm 130
  118. ==
  119.           THEN SBRK
  120. empt wrt
  121. "   -- Break sent --"
  122. wrt
  123.           ELSE
  124.             IF nm
  125. 132 ==
  126.             THEN
  127. krm
  128.             ELSE
  129.               IF nm
  130. 131 ==
  131.               THEN
  132. quit
  133.               ELSE
  134. IF nm 133 ==
  135. THEN RECV
  136. END
  137.               END
  138.             END
  139.           END
  140.         END
  141.       END
  142.     END
  143.   \>>
  144.   \<< 13 CF 14 CF
  145.     DO BUFLEN KEY
  146. DUP
  147.       IF 0 \=/
  148.       THEN 13 SF
  149. DROP 'k' STO
  150.       ELSE DROP
  151.       END
  152.       IF DROP 0 \=/
  153.       THEN 14 SF
  154.       END
  155.     UNTIL 13 FS? 14
  156. FS? OR
  157.     END
  158.     IF 13 FS?
  159.     THEN
  160.       IF 27 FS?
  161.       THEN 2
  162.       ELSE
  163.         IF 26 FS?
  164.         THEN 1
  165.         ELSE 3
  166.         END
  167.       END 'keys'
  168. SWAP GET k k SUB
  169. snd DROP
  170.     END
  171.     IF 14 FS?
  172.     THEN BUFLEN
  173. DROP
  174.       IF DUP 20 >
  175.       THEN DROP 21
  176.       END SRECV
  177. DROP wrt
  178.     END term2
  179.   \>> {
  180. "..........ABCDEF....GHIJKL....MNOPQR....STUVWX....YZ\v/\GS.....\.V789......\<)456*.....\x-123-......0. +"
  181. "..............     .  .............\v/\.S.....\.V.........\<).........\x-................."
  182. "..........abcdef....ghijkl....mnopqr....stuvwx....yz\v/ .....\.V789......\<)456*.....\x-123-......0. +"
  183. }
  184. "                      "
  185.   \<< 19 CHR XMIT
  186. DROP empt wrt
  187. "File: " wrt 0 \-> q
  188.     \<< ""
  189.       DO
  190.         DO KEY
  191.         UNTIL
  192.         END
  193.         IF DUP 51
  194. SAME
  195.         THEN 1 'q'
  196. STO+
  197.         ELSE keys 1
  198. GET SWAP DUP SUB
  199. DUP wrt +
  200.         END
  201.       UNTIL q
  202.       END
  203.     \>> DROP 17 CHR
  204. XMIT DROP STR\-> SEND
  205.   \>>
  206.   \<< { k nm string
  207. krm empt keys term2
  208. snd wrt quit }
  209. PURGE CLOSEIO
  210.   \>> 'quit' STO
  211. 'krm' STO 'empt'
  212. STO 'keys' STO
  213. 'term2' STO 'snd'
  214. STO 'wrt' STO CLLCD
  215. "" 'string' STO
  216. OPENIO 13 CF 14 CF
  217. 27 CF term2
  218. \>>
  219.  
  220.